package com.github.cyf.interceptor.page;

import lombok.Data;

import java.util.ArrayList;

/**
 * @author chenyifan
 * @create 2024-04-13 19:06
 */
@Data
public class Page<E> extends ArrayList<E> {

    private int pageNo;
    private int pageSize;
    private int total;

    public Page() {
    }

    public Page(int pageNo, int pageSize) {
        if (pageNo < 0) {
            throw new IllegalArgumentException("页码不能小于 0");
        }
        if (pageSize < 0) {
            throw new IllegalArgumentException("每页条数不能小于 0");
        }
        this.pageNo = pageNo;
        this.pageSize = pageSize;
    }

}
